package br.com.ir.tcc.geco.modelo;

// default package
// Generated 23/08/2009 11:59:00 by Hibernate Tools 3.2.5.Beta

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name = "combinacao", catalog = "tcc")
public class Combinacao implements java.io.Serializable {

	private static final long serialVersionUID = -673656738518436247L;
	
	private Integer id;
	private Modelo modelo;
	private String descricao;
	private Set<CombinacaoTemplate> combinacaoTemplates = new HashSet<CombinacaoTemplate>(0);

	public Combinacao() {
	}

	public Combinacao(Modelo modelo) {
		this.modelo = modelo;
	}

	public Combinacao(Modelo modelo, String descricao,
			Set<CombinacaoTemplate> combinacaoTemplates) {
		this.modelo = modelo;
		this.descricao = descricao;
		this.combinacaoTemplates = combinacaoTemplates;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "modelo_id", nullable = false)
	public Modelo getModelo() {
		return this.modelo;
	}

	public void setModelo(Modelo modelo) {
		this.modelo = modelo;
	}

	@Column(name = "descricao", length = 200)
	public String getDescricao() {
		return this.descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "combinacao", cascade=CascadeType.REMOVE)
	public Set<CombinacaoTemplate> getCombinacaoTemplates() {
		return this.combinacaoTemplates;
	}

	public void setCombinacaoTemplates(
			Set<CombinacaoTemplate> combinacaoTemplates) {
		this.combinacaoTemplates = combinacaoTemplates;
	}

}
